<template xmlns="http://www.w3.org/1999/html">
  <sea-data-table ref="tableObject" url="/sys/variable/page">
    <!--表头-->
    <sea-table-header slot="header">
      <!--标题栏-->
      <sea-table-title slot="title" title="系统参数管理"
                      subtitle="因为与系统运行有关，需要按业务需求，将参数配置权限下发下去"></sea-table-title>

    </sea-table-header>

    <!-- 弹窗、抽屉 -->
    <template slot="drawer">
      <sea-dialog ref="modify_dialog">
        <modify ref="modify" :object="row_data"></modify>
      </sea-dialog>
    </template>

    <!--表头-->
    <template slot="columns">
      <el-table-column width="180" label="ID">
        <a slot-scope="{row, column, $index}" @click="onAction('detail', row)"
           class="inline-block" style="width: 100%">{{ row.userId }}.{{ row.name }}</a>
      </el-table-column>
      <el-table-column property="label" label="Label" width="180"></el-table-column>
      <el-table-column property="description" label="描述" show-overflow-tooltip></el-table-column>
    </template>
  </sea-data-table>
</template>

<script>

import modify from "./modify";

/**
 *
 * 系统访问日志
 */
export default {
    components: {modify}
    , data() {
        return {
            // 操作名称
            operation: undefined
            // 当前操作的行级对象
            , row_data: {}
        }
    },
    methods: {
        /**
         * 操作栏事件分发
         * @param evt 事件
         * @param row 行级对象
         * @param old 可供回滚的参数
         */
        onAction: function (evt, row, old) {
            if (evt === 'detail') {
                let dialog = {title: `详情`, fullscreen: true};
                this.$refs.modify_dialog.open(dialog).then(() => {
                    this.row_data = row;
                });
            }
        }
    }
}
</script>
